<?xml version="1.0" encoding="ISO-8859-1" ?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
	<title>Cadastro de Paciente</title>
</head>

<body>
   <ui:composition template="templateMenu.xhtml">
		<ui:define name="content">
	<h1>Cadastramento de Paciente</h1>
	<h:form id="cadastro">
		<h:messages />
		<h:inputHidden value="#{pacienteBean.paciente.idPaciente}"  />

		<h:panelGrid columns="2">

			<h:outputLabel value="Nome: " for="nome" />
			<h:inputText id="nome" label="Nome"
				value="#{pacienteBean.paciente.nome}" size="45" required="true"
				requiredMessage="Por favor, digite seu nome: "
				validatorMessage="O nome deve ser de 5 a 45 caracteres.">
				<f:validateLength minimum="5" maximum="45" />
			</h:inputText>

			<h:outputLabel value="CPF: " for="cpf" />
			<h:inputText id="cpf" label="Cpf:"
				value="#{pacienteBean.paciente.cpf}" size="20" maxlength="20"
				required="true" requiredMessage="Por favor digite seu login.">
			</h:inputText>

			<h:outputLabel value="RG: " for="rg" />
			<h:inputText id="rg" label="Rg:"
				value="#{pacienteBean.paciente.rg}" size="15" maxlength="15"
				required="true" redisplay="true" />
				

			<h:outputLabel value="Data de Nascimento: " for="nascimento" />
			<h:inputText id="nascimento" label="Data de Nascimento:" value="#{pacienteBean.paciente.dataNascimento}"
				size="15" maxlength="15" redisplay="true">
			  <f:convertDateTime pattern="dd/MM/yyyy"/>	
			</h:inputText>
				
			<h:outputLabel value ="Sexo:" />
			<h:selectOneMenu value="#{pacienteBean.paciente.sexo}">
			  <f:selectItems value ="#{pacienteBean.listSexoPaciente}" />
			</h:selectOneMenu>	

		</h:panelGrid>

		<h:commandButton action="#{pacienteBean.salvar}" value="Salvar" />
	</h:form>
  </ui:define>
  </ui:composition>
</body>
</html>